<?php
	$setDate = !empty($_REQUEST['setDate']) ? $_REQUEST['setDate'] : date('Y-m-d', time()); 
	$linenum = isset($_REQUEST['linenum']) ? $_REQUEST['linenum'] : '10';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의신</title>
	
	<link rel="stylesheet" type="text/css" href="/css/common.css">
	<link rel="stylesheet" type="text/css" href="/css/sub.css">
	<link rel="stylesheet" type="text/css" href="/css/free1.css">
	<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script> 
	<script type="text/javascript" src="/js/lib/myconfig.jquery.datepicker.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#today").datepicker();
			$("img.ui-datepicker-trigger").attr("style","margin-left:5px; vertical-align:middle; cursor:pointer;"); //이미지버튼 style적용
			$("#ui-datepicker-div").hide(); //자동으로 생성되는 div객체 숨김 

			// 달력으로 날짜 선택
			$("#today").change(function() {
				location.href='/unse/free/todaylinesc/result?setDate='+this.value;
			});
			
			// 메뉴 링크 설정
			// $(".zodiac .sign ul li a").each(function(index) {
				// $(this).click(function() {
					// $(".conts .zbox").hide();
					// var linename = $(this).text();
					// $(".conts .zbox .title dl dt").each(function(index) {
						// if (linename == $(this).text()) {
							// $(".conts .zbox").eq(index).show();
						// }
					// });
				// });
			// });
			
			// 기본적으로 성격 탭을 보여준다. 
			//$(".conts .zbox").hide();
			//$(".conts .zbox").eq($("#linenum").val()).show();
			
			$(".year tbody tr:last th").addClass('end');
			$(".year tbody tr:last td").addClass('end');
		});
	</script>

</head>
<body style="margin:0; padding:0; width:580px;">
<input type="hidden" id="linenum" value="<?=$linenum?>" />

			<div class="zodiac">
				<h3 class="freetit"><img src="/images/free/todayline_banner1.png" alt="오늘의 띠별 운세" /></h3>
				
					
					<div class="todaydate">
						<p class="year">
							<img src="/images/common/day/day_<?=substr($setDate, 0,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 1,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 2,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 3,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_dot.png" alt="점" />
						</p>
						<p>
							<img src="/images/common/day/day_<?=substr($setDate, 5,1)?>.png" alt="월" />
							<img src="/images/common/day/day_<?=substr($setDate, 6,1)?>.png" alt="월" />
							<img src="/images/common/day/day_dot.png" alt="점" />
						</p>
						<p>
							<img src="/images/common/day/day_<?=substr($setDate, 8,1)?>.png" alt="일" />
							<img src="/images/common/day/day_<?=substr($setDate, 9,1)?>.png" alt="일" />
						</p>
						<input type="hidden" name="today" id="today" value="<?=$setDate?>" />
					</div><!--date-->
					
					<div class="conts">
<?	$no = 0; ?>
<?	foreach ($contents['F022'] as $item) : ?>
<?
		$no++;
		$str_num = strlen($no) == 1 ? '0'.$no : $no;
		$arr_tmp = explode(":", $item['db_data2']);
		$data[0]['title'] = trim($arr_tmp[0]);
		$data[0]['content'] = trim($arr_tmp[1]);
		$arr_tmp = explode(":", $item['db_data3']);
		$data[1]['title'] = trim($arr_tmp[0]);
		$data[1]['content'] = trim($arr_tmp[1]);
		$arr_tmp = explode(":", $item['db_data4']);
		$data[2]['title'] = trim($arr_tmp[0]);
		$data[2]['content'] = trim($arr_tmp[1]);
		if (!empty($item['db_data5'])) {
			$arr_tmp = explode(":", $item['db_data5']);
			$data[3]['title'] = trim($arr_tmp[0]);
			$data[3]['content'] = trim($arr_tmp[1]);
		}
?>
						<div class="zbox">
							<div class="title">
								<dl>
									<dt class="sign<?=$str_num?>"><?=$item['line_name']?></dt>
									<dd><?=$item['db_data1']?></dd>
								</dl>
							</div><!--title-->
							<div class="year">
								 <table width="100%" summary="띠 년도별운세" cellpadding="0" cellspacing="0">
									<caption class="blind"> 년도운세</caption>
									<colgroup>
										<col width="10%" />
										<col width="*" />
									</colgroup>
									<tbody>
<?		foreach ($data as $cont) : ?>
										<tr>
											<th scope="row"><?=$cont['title']?></th>
											<td><?=$cont['content']?></td>
										</tr>
<?		endforeach ?>
									</tbody>
								 </table>
							</div><!--year-->
						</div><!--zbox-->
<?	endforeach ?>
					</div><!--conts-->
				</div><!--box-->
                <!--운신배너-->
<p><a href="http://www.unsin.co.kr/" target="_blank"><img src="/images/free/bn_free_info.png" /></a></p>
<!--//운신배너-->
			</div><!--zodiac-->

   
</div>
</body>
</html>